package com.yuxl.common.auth.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.relational.core.mapping.Table;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author yuxl
 */
@Schema(description = "菜单实体")
@Table("auth_menu")
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class AuthMenu {

    @Id
    @Schema(description = "菜单名称")
    private String name;
    @Schema(description = "上级菜单名称")
    private String supName;
    @Schema(description = "菜单标题")
    private String title;
    @Schema(description = "菜单图标")
    private String icon;
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Transient
    @Schema(description = "下级菜单列表")
    private List<AuthMenu> children;
} 